<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layout 管理界面大布局示例 - Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="./layui-v2.11.2/layui/css/layui.css" rel="stylesheet">
    <link rel="stylesheet" href="./商品管理.css">
    <style>
        .hide {
            display: none;
        }
    </style>
</head>

<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo layui-hide-xs layui-bg-black">商品管理后台</div>
            <!-- 头部区域（可配合layui 已有的水平导航） -->
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                    <a id="user_image" href="javascript:;">
                        <img src="../作业/images/年2.jpg" class="layui-nav-img">
                    </a>
                    <dl class="layui-nav-child">
                        <dd id="personal_center"><a href="javascript:;">个人中心</a></dd>
                        <!-- <dd><a href="javascript:;">Settings</a></dd> -->
                        <dd id="exit"><a href="javascript:;">退出登录</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                    <a href="javascript:;">
                        <i class="layui-icon layui-icon-more-vertical"></i>
                    </a>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed goods">
                        <a class="" href="javascript:;">商品管理</a>
                        <dl class="layui-nav-child">
                            <dd class="goods_look"><a href="javascript:;">查看全部</a></dd>
                            <dd class="goods_add"><a href="javascript:;">添加商品</a></dd>
                            <!-- <dd class="goods_del"><a href="javascript:;">删除商品</a></dd> -->
                            <dd class="goods_updata"><a href="javascript:;">更新商品</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">商品图表</a>
                        <dl class="layui-nav-child">
                            <dd onclick="dian()"><a href="javascript:;">价格表</a></dd>
                        </dl>
                    </li>
                    <!-- <li class="layui-nav-item"><a href="javascript:;">click menu item</a></li>
                    <li class="layui-nav-item"><a href="javascript:;">the links</a></li> -->
                </ul>
            </div>
        </div>
        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;">
                <blockquote class="layui-elem-quote layui-text">
                    <span>商品管理</span>
                </blockquote>
                <div class="layui-card layui-panel">
                    <div class="layui-card-header goods_title">
                        <ul>
                            <li>名称</li>
                            <li>图片</li>
                            <li>价格</li>
                            <li>已售</li>
                            <li>是否上架</li>
                            <li>库存</li>
                            <li>操作</li>
                            <li class="goods_sort">

                                <select class="up_down">
                                    <option value="asc">升序</option>
                                    <option value="desc">降序</option>
                                </select>
                                <select class="p_s_s">
                                    <option value="price">价格</option>
                                    <option value="stock">库存</option>
                                    <option value="sold">已售</option>
                                </select>
                                <button onclick="g_sort()">排序</button>
                            </li>
                            <li class="search_li"><input type="text" class="goods_search"><button
                                    onclick="goods_search()">搜索</button></li>
                        </ul>
                    </div>
                    <div class="layui-card-body goods_body">



                    </div>
                </div>
                <br><br>
            </div>
            <!-- 详情 -->
            <div class="g_details hide">

            </div>
        </div>
        <div class="layui-footer">
            <!-- 分页 -->
            <div id="demo-laypage-normal-2" class="page"></div>

        </div>
    </div>
    <script src="./jquery.3.7.1.js"></script>
    <script src="./layui-v2.11.2/layui/layui.js"></script>
    <script src="./商品管理.js"></script>
    <script>
        // 当前路径
        let aa = document.location.href
        // 商品管理路径
        let local_herf = `file:///F:/VS/%E4%B8%89%E6%AE%B5/%E9%A1%B9%E7%9B%AE-%E5%95%86%E5%93%81%E7%AE%A1%E7%90%86/%E5%95%86%E5%93%81%E7%AE%A1%E7%90%86.html`
        function dian() {
            if (aa == local_herf) {
                location.assign('./商品图表.html')
            }
        }
        let user_image = document.querySelector('#user_image')//头像父级
        let old_img = document.querySelector('#user_image img')//默认头像
        let img_ = document.createElement('img');//创建头像img
        window.onload = function () {
            img_.src = JSON.parse(localStorage.getItem('userImg'))
            img_.classList.add('layui-nav-img')
            user_image.removeChild(old_img)
            user_image.prepend(img_)

        }
    </script>
</body>

</html>